Matthias Clasen [Wed, 3 Aug 2016 00:13:21 +0000 (20:13 -0400)]
button: Convert to indirect rendering
WARNING! This commit breaks GtkButton subclasses.
Matthias Clasen [Tue, 2 Aug 2016 23:45:47 +0000 (19:45 -0400)]
Convert GtkGrid to indirect rendering
Following the example of GtkBox.
Emmanuele Bassi [Wed, 3 Aug 2016 15:51:21 +0000 (16:51 +0100)]
gsk: Add GskProfiler to GskRenderer
The profiler instance is per-renderer, and is accesible to
implementations.
Emmanuele Bassi [Wed, 3 Aug 2016 15:48:49 +0000 (16:48 +0100)]
gsk: Add profiler object
The GskProfiler holds counters and timers, and will be used by the
renderer implementations to acquire frame timings.
Emmanuele Bassi [Tue, 2 Aug 2016 17:44:06 +0000 (18:44 +0100)]
box: Port from immediate to deferred rendering
Drop the ::draw() vfunc implementation in favour of the
::get_render_node() vfunc.
Emmanuele Bassi [Tue, 2 Aug 2016 17:42:51 +0000 (18:42 +0100)]
Integrate CSS gadget with GSK render nodes
First stab at an internal API that generates render nodes when drawing a
CSS gadget.
Emmanuele Bassi [Tue, 2 Aug 2016 16:01:08 +0000 (17:01 +0100)]
gtk: Update the coordinates when propagating render nodes
Just like gtk_container_propagate_draw() does for the immediate mode
rendering.
Emmanuele Bassi [Tue, 2 Aug 2016 15:58:47 +0000 (16:58 +0100)]
Use the projection to flip around the content
Since we use an FBO to render the contents of the render node tree, the
coordinate space is going to be flipped in GL. We can undo the flip by
using an appropriate projection matrix, instead of changing the sampling
coordinates in the shaders and updating all our coordinates at render
time.
Emmanuele Bassi [Mon, 1 Aug 2016 15:19:31 +0000 (16:19 +0100)]
widget: Fix compatibility fallbacks
Emmanuele Bassi [Thu, 28 Jul 2016 15:20:26 +0000 (16:20 +0100)]
gsk: Add texture size to debug message
Emmanuele Bassi [Wed, 27 Jul 2016 15:48:35 +0000 (16:48 +0100)]
gsk: Take into account the scaling factor
We need to apply a scaling factor whenever we deal with user-supplied
coordinates, like:
- when creating textures
- when setting up the viewport
- when submitting the scene
Emmanuele Bassi [Wed, 27 Jul 2016 15:23:44 +0000 (16:23 +0100)]
gsk: Tie render nodes to renderers
Render nodes need access to rendering information like scaling factors.
If we keep render nodes separate from renderers until we submit a nodes
tree for rendering we're going to have to duplicate all that information
in a way that makes the API more complicated and fuzzier on its
semantics.
By having GskRenderer create GskRenderNode instances we can tie nodes
and renderers together; since higher layers will also have access to
the renderer instance, this does not add any burden to callers.
Additionally, if memory measurements indicate that we are spending too
much time in the allocation of new render nodes, we can now easily
implement a free-list or a renderer-specific allocator without breaking
the API.
Emmanuele Bassi [Wed, 27 Jul 2016 10:34:20 +0000 (11:34 +0100)]
gsk: Bind GL context to the GL profiler
Similarly to how we bind it to the GL driver object used by the GSK GL
renderer.
Emmanuele Bassi [Wed, 27 Jul 2016 08:42:25 +0000 (09:42 +0100)]
gtk: Port GtkWindow to render nodes
WARNING: BROKEN COMMIT
Emmanuele Bassi [Wed, 27 Jul 2016 08:40:29 +0000 (09:40 +0100)]
gtk: Add GtkContainer API to gather render nodes
We cannot implement GtkWidgetClass.get_render_node() in GtkContainer
without breaking the fallback path that renders a widget to a single
render node rasterization. For GtkContainer subclasses we should provide
a simple API, similar to gtk_container_propagate_draw(), that gathers
all the render nodes for each child.
Emmanuele Bassi [Wed, 27 Jul 2016 08:39:55 +0000 (09:39 +0100)]
gtk: Name GSK render nodes
For debugging purposes it's helpful to name the nodes.
Emmanuele Bassi [Mon, 25 Jul 2016 16:36:33 +0000 (17:36 +0100)]
gsk: Fix build without Wayland
Emmanuele Bassi [Mon, 25 Jul 2016 16:15:05 +0000 (17:15 +0100)]
gsk: Add redirection to FBOs for opacity groups
If a node is non-opaque and has a non-zero opacity we need to paint its
contents and children first to an off screen buffer, and then render the
resulting texture at the desired opacity — otherwise the opacities will
combine and result in the wrong rendering.
Emmanuele Bassi [Thu, 21 Jul 2016 16:19:53 +0000 (17:19 +0100)]
gsk: Drop opaque/transparent item split
We're not going to use separate rendering lists soon, and the way we
render items is less similar to a gaming engine and more similar to a
simpler compositor. This means we don't need to perform a two pass
rendering — opaque items first, transparent items later.
Emmanuele Bassi [Thu, 21 Jul 2016 16:17:49 +0000 (17:17 +0100)]
gsk: Rename uniforms and attributes in shaders
Use appropriate names, and annotate the names with the types — 'u' for
uniforms, 'a' for attributes. The common preambles for shaders are split
from the bodies, so we need some way to distinguish the uniforms and the
attributes just from their name.
Emmanuele Bassi [Wed, 20 Jul 2016 16:55:35 +0000 (17:55 +0100)]
gsk: Move resource handling inside GskGLDriver
We want the GL driver to cache as many resources as possible, so we can
always ensure that we're in a consistent state, and we can handle state
transitions more appropriately.
Emmanuele Bassi [Tue, 19 Jul 2016 13:42:54 +0000 (14:42 +0100)]
gsk: Simplify buffer handling in GskGLRenderer
We don't have optional stencil and depth buffers, like GtkGLArea: we
always create both of them internally.
Emmanuele Bassi [Tue, 19 Jul 2016 13:34:24 +0000 (14:34 +0100)]
gsk: Drop render buffer code path from GskGLRenderer
We always use texturing, to preserve the alpha channel when blitting the
frame buffer object on the window surface.
Emmanuele Bassi [Tue, 19 Jul 2016 13:32:17 +0000 (14:32 +0100)]
gsk: Rework surface -> texture API
Drop the texture parameters handling from the texture creation, and
associate them with the contents upload. Also, rename the function to
something more in line with what it does.
Emmanuele Bassi [Tue, 12 Jul 2016 14:41:31 +0000 (15:41 +0100)]
gsk: Add GL driver API to create render targets
It's going to be used by the GL renderer to safely create and bind
FBOs when needed.
Emmanuele Bassi [Tue, 12 Jul 2016 13:59:37 +0000 (14:59 +0100)]
gsk: Turn texture cache into a hash table
We want to add the list of FBOs tied to a texture; this means we cannot
trivally copy the Texture structure when adding it to a GArray. We're
also going to have more textures than VAOs, so it makes more sense to
use a O(1) access data structure for them.
Emmanuele Bassi [Tue, 12 Jul 2016 13:50:48 +0000 (14:50 +0100)]
gsk: Add GL profiler
We can use the GL_ARB_timer_query extension (available since OpenGL
3.2, and part of the OpenGL specification since version 3.3) to query
the time elapsed when drawing each frame. This allows us to gather
timing information on our use of the GPU.
Emmanuele Bassi [Tue, 12 Jul 2016 10:15:45 +0000 (11:15 +0100)]
gsk: Split surface upload from texture creation
We're going to need a method to create textures without a surface.
Emmanuele Bassi [Fri, 8 Jul 2016 15:40:42 +0000 (16:40 +0100)]
gsk: Enable depth testing
Use the appropriate depth testing function for transparent items.
Emmanuele Bassi [Fri, 8 Jul 2016 15:26:44 +0000 (16:26 +0100)]
gsk: Use consistent naming for blend fragment shader
This should make it immediately clear if we're doing something wrong.
Emmanuele Bassi [Fri, 8 Jul 2016 15:24:35 +0000 (16:24 +0100)]
gsk: Fix pre-condition check
We warn if the node is marked as not mutable.
Emmanuele Bassi [Fri, 8 Jul 2016 15:23:49 +0000 (16:23 +0100)]
gsk: Flip mutability on GskRenderNode.finalize
We use the public API when removing children nodes, so we need to mark
the node as mutable while we destroy it.
Emmanuele Bassi [Fri, 8 Jul 2016 15:22:33 +0000 (16:22 +0100)]
gsk: Add specific debug type for shaders
So that we don't lose GskShaderBuilder debugging messages in the stream
of GskGLRenderer ones.
Emmanuele Bassi [Fri, 8 Jul 2016 15:21:13 +0000 (16:21 +0100)]
gsk: Add GskGLDriver
We can move the caching and management of textures, VAOs, and state of
the GL machinery into a single object, GskGLDriver.
Emmanuele Bassi [Wed, 6 Jul 2016 16:10:12 +0000 (17:10 +0100)]
gsk: Use the right pointer to the parent RenderItem
We copy the local RenderItem into the render items array, so we need to
use the copy in the array in order to get the correct reference.
Emmanuele Bassi [Tue, 5 Jul 2016 10:58:44 +0000 (11:58 +0100)]
Ensure that render nodes are translated
The clip rectangle may have non-zero offsets, so we need to ensure that
the GskRenderNode associated to the rendered area is translated by those
same offsets.
Emmanuele Bassi [Mon, 4 Jul 2016 13:07:24 +0000 (14:07 +0100)]
gsk: Add fundamental type annotations for GskRenderNode
We need to annotate the GskRenderNode so that the introspection
machinery can find the functions for managing reference counting
and GValues.
Emmanuele Bassi [Mon, 4 Jul 2016 12:55:00 +0000 (13:55 +0100)]
gsk: Add 'blit' program
For the root node we do not need to use blending, as it does not have
any backdrop to blend into. We can use a simpler 'blit' program that
only takes the content of the source and fills the texture quad with
it.
Emmanuele Bassi [Mon, 4 Jul 2016 12:46:22 +0000 (13:46 +0100)]
gsk: Consolidate program creation and storage
We should use ShaderBuilder to create and store programs for the GL
renderer. This allows us to simplify the creation of programs (by moving
the compilation phase into the ShaderBuilder::create_program() method),
and move towards the ability to create multiple programs and just keep a
reference to the program id.
Emmanuele Bassi [Sun, 3 Jul 2016 23:23:19 +0000 (00:23 +0100)]
docs: Add more GSK documentation
Emmanuele Bassi [Sun, 3 Jul 2016 22:02:56 +0000 (23:02 +0100)]
gsk: Add more modes to the blend shader
Use the compositing CSS spec at:
https://www.w3.org/TR/compositing-1/#blending
For the implementation.
Emmanuele Bassi [Sun, 3 Jul 2016 21:54:30 +0000 (22:54 +0100)]
gsk: Don't store the uniform and attribute location twice
We should keep the ShaderBuilder around and use it to query the various
uniform and attribute locations when needed, instead of storing those
offsets into the Renderer instance, and copying them. This allows a bit
more flexibility, once we have more than one program built into the
renderer.
Emmanuele Bassi [Sun, 3 Jul 2016 21:53:16 +0000 (22:53 +0100)]
gsk: Add getter for program id in ShaderBuilder
Since we store it into the ShaderBuilder instance we should also allow
getting the program id.
Emmanuele Bassi [Sun, 3 Jul 2016 21:38:27 +0000 (22:38 +0100)]
gsk: Add debugging notes to ShaderBuilder
Print out the generated shader and the list of available uniforms and
attributes.
Emmanuele Bassi [Sun, 3 Jul 2016 20:12:22 +0000 (21:12 +0100)]
gsk: Rework how GLSL shaders are built
The GL renderer should build the GLSL shaders using GskShaderBuilder.
This allows us to separate the common parts into separate files, and
assemble them as necessary, instead of shipping one big shader per type
of GL API (GL3, GL legacy, and GLES).
Emmanuele Bassi [Sun, 3 Jul 2016 19:04:40 +0000 (20:04 +0100)]
gsk: Add ShaderBuilder
GskShaderBuilder is an ancillary, private type that deals with the
internals of taking GLSL shaders from resources and building them,
with the additional feature of being able to compose shaders from a
common preamble, as well as adding conditional defines (useful for
enabling debugging code in the shaders themselves).
Emmanuele Bassi [Sun, 3 Jul 2016 17:59:32 +0000 (18:59 +0100)]
gsk: Add rendering debug mode for shaders
It's going to be useful to inject debugging data into the shaders used
by GSK.
Emmanuele Bassi [Fri, 1 Jul 2016 15:17:14 +0000 (16:17 +0100)]
gdk: Add more GDK_GL_ERROR error ids
We're going to use them in other locations.
Emmanuele Bassi [Fri, 1 Jul 2016 11:15:56 +0000 (12:15 +0100)]
gsk: Use the node's blend mode in the GL renderer
Emmanuele Bassi [Fri, 1 Jul 2016 11:12:30 +0000 (12:12 +0100)]
gsk: Store blend mode in the render node
Emmanuele Bassi [Fri, 1 Jul 2016 11:02:43 +0000 (12:02 +0100)]
gsk: Make GskBlendMode enumeration public
Emmanuele Bassi [Thu, 30 Jun 2016 16:06:31 +0000 (17:06 +0100)]
gsk: Allow sampling between parent and child nodes
Emmanuele Bassi [Thu, 30 Jun 2016 14:07:16 +0000 (15:07 +0100)]
gsk: Group render state attributes
Emmanuele Bassi [Wed, 29 Jun 2016 18:05:33 +0000 (19:05 +0100)]
gsk: Turn GskRenderNode into a pure GTypeInstance
Using GObject as the base type for a transient tree may prove to be too
intensive, especially when creating a lot of node instances. Since we
don't need properties or signals, and we don't need complex destruction
semantics, we can use GTypeInstance directly as the base type for
GskRenderNode.
Emmanuele Bassi [Thu, 23 Jun 2016 16:35:42 +0000 (17:35 +0100)]
gtk: Use GskRenderNode to render widgets
We need a virtual function to retrieve the GskRenderNode for each
widget, which is supposed to attach its own children's GskRenderNodes.
Additionally, we want to maintain the existing GtkWidget::draw mechanism
for widgets that do not implement get_render_node() — as well as widgets
that have handlers connected to the ::draw signal.
Emmanuele Bassi [Thu, 23 Jun 2016 16:34:38 +0000 (17:34 +0100)]
gtk: Add a GskRenderer to GtkWindow
Each top-level should have its own GskRenderer, to be used when drawing
the render node tree.
Emmanuele Bassi [Wed, 22 Jun 2016 16:30:36 +0000 (17:30 +0100)]
gsk: Rework GskRenderer and GskRenderNode semantics
This commit changes the way GskRenderer and GskRenderNode interact and
are meant to be used.
GskRenderNode should represent a transient tree of rendering nodes,
which are submitted to the GskRenderer at render time; this allows the
renderer to take ownership of the render tree. Once the toolkit and
application code have finished assembling it, the render tree ownership
is transferred to the renderer.
Emmanuele Bassi [Tue, 26 Apr 2016 13:23:12 +0000 (14:23 +0100)]
gsk: Flush the GL render items cache
Whenever the render tree changes we want to drop the RenderItem arrays,
as each item contains a pointer to the GskRenderNode which becomes
dangling once the root node changed.
Emmanuele Bassi [Tue, 26 Apr 2016 13:22:25 +0000 (14:22 +0100)]
gsk: Add GskRenderer::clear_tree
We need a way to clear eventual caches inside GskRenderer subclasses if
the root node has changed.
Emmanuele Bassi [Mon, 25 Apr 2016 11:26:46 +0000 (12:26 +0100)]
gsk: Port GskGLRenderer to GLES
Use the appropriate API and shaders if the GdkGLContext was created for
OpenGL ES instead of OpenGL.
Emmanuele Bassi [Mon, 25 Apr 2016 10:41:15 +0000 (11:41 +0100)]
gsk: Use surface-to-texture utility function
Now that we have it.
Emmanuele Bassi [Mon, 25 Apr 2016 10:09:25 +0000 (11:09 +0100)]
gsk: Rename shaders for OpenGL
Emmanuele Bassi [Mon, 25 Apr 2016 10:29:14 +0000 (11:29 +0100)]
gdk: Add utility for uploading Cairo surfaces to GL
The surface-to-GL upload logic has become more complicated with the
addition of the GLES code paths; it's more logical to have a public
utility function that can be called from GDK users, instead of copy
pasting the whole thing multiple times.
Emmanuele Bassi [Wed, 20 Apr 2016 15:00:45 +0000 (16:00 +0100)]
build: Add GSK deps to GTK
Emmanuele Bassi [Thu, 17 Mar 2016 13:48:19 +0000 (13:48 +0000)]
Initial implementation of GSK rendering pipeline
GSK is conceptually split into two scene graphs:
* a simple rendering tree of operations
* a complex set of logical layers
The latter is built on the former, and adds convenience and high level
API for application developers.
The lower layer, though, is what gets transformed into the rendering
pipeline, as it's simple and thus can be transformed into appropriate
rendering commands with minimal state changes.
The lower layer is also suitable for reuse from more complex higher
layers, like the CSS machinery in GTK, without necessarily port those
layers to the GSK high level API.
This lower layer is based on GskRenderNode instances, which represent
the tree of rendering operations; and a GskRenderer instance, which
takes the render nodes and submits them (after potentially reordering
and transforming them to a more appropriate representation) to the
underlying graphic system.
Emmanuele Bassi [Tue, 14 Jan 2014 13:01:35 +0000 (13:01 +0000)]
gsk: Initial commit / build environment
Emmanuele Bassi [Tue, 18 Oct 2016 10:29:06 +0000 (11:29 +0100)]
label: Avoid shadowing variables
Piotr Drąg [Tue, 18 Oct 2016 01:50:55 +0000 (03:50 +0200)]
Update POTFILES.in
Matthias Clasen [Mon, 17 Oct 2016 19:28:29 +0000 (15:28 -0400)]
Add a test for cursor names
This tests both that all standard cusor yield a cursor, and that
unknown cursor names yield NULL.
Matthias Clasen [Mon, 17 Oct 2016 19:27:15 +0000 (15:27 -0400)]
x11: Add the same message as the wayland backend has
This seems prudent, if we make noise about missing cursors
on Wayland, we should do the same on X11.
Matthias Clasen [Mon, 17 Oct 2016 19:26:29 +0000 (15:26 -0400)]
Reduce a warning to a message
The warning interferes with having a testcase to check this behavior,
so reduce this to a message.
Timm Bäder [Sun, 16 Oct 2016 18:56:47 +0000 (20:56 +0200)]
Remove GtkAction
Timm Bäder [Sun, 16 Oct 2016 18:46:37 +0000 (20:46 +0200)]
Remove GtkActionGroup
Timm Bäder [Mon, 17 Oct 2016 07:14:39 +0000 (09:14 +0200)]
Fix unittests
Timm Bäder [Mon, 17 Oct 2016 07:13:51 +0000 (09:13 +0200)]
widget: Not all toplevels are also containers
Timm Bäder [Sun, 16 Oct 2016 19:25:38 +0000 (21:25 +0200)]
tests/testylecontext: Don't double-free widgetpath
Timm Bäder [Sun, 16 Oct 2016 17:35:49 +0000 (19:35 +0200)]
Remove GtkRecentAction
Timm Bäder [Sun, 16 Oct 2016 17:28:11 +0000 (19:28 +0200)]
Remove GtkUIManager
Timm Bäder [Sun, 16 Oct 2016 16:48:05 +0000 (18:48 +0200)]
Remove GtkActivatable
Timm Bäder [Sun, 16 Oct 2016 16:32:10 +0000 (18:32 +0200)]
recentchooser: Stop implementing GtkActivatable
Timm Bäder [Sun, 16 Oct 2016 16:26:00 +0000 (18:26 +0200)]
recentchooserdefault: Stop implementing GtkActivatable
Timm Bäder [Sun, 16 Oct 2016 16:22:29 +0000 (18:22 +0200)]
toolitem: Stop implementing GtkActivatable
Timm Bäder [Sun, 16 Oct 2016 16:08:39 +0000 (18:08 +0200)]
Remove GtkToggleAction
Timm Bäder [Sun, 16 Oct 2016 15:46:00 +0000 (17:46 +0200)]
Remove GtkRadioAction
Timm Bäder [Sun, 16 Oct 2016 11:12:16 +0000 (13:12 +0200)]
Remove GtkStock
Timm Bäder [Sun, 16 Oct 2016 10:55:27 +0000 (12:55 +0200)]
infobar: Stop looking at stock items
GtkButton doesn't have a use-stock property anymore anyway.
Timm Bäder [Sat, 15 Oct 2016 19:56:09 +0000 (21:56 +0200)]
window: Remove decoration-button-layout style property
GtkSettings has a gtk-decoration-layout property for this.
Timm Bäder [Sat, 15 Oct 2016 19:55:38 +0000 (21:55 +0200)]
window: Remove decoration-resize-handle style property
Timm Bäder [Sat, 15 Oct 2016 19:34:32 +0000 (21:34 +0200)]
toolbar: Remove max-child-expand child property
Timm Bäder [Sat, 15 Oct 2016 15:43:56 +0000 (17:43 +0200)]
Remove GtkAlignment
Timm Bäder [Fri, 14 Oct 2016 20:07:36 +0000 (22:07 +0200)]
gtkapplication: Remove deprecated API
Timm Bäder [Fri, 14 Oct 2016 20:01:59 +0000 (22:01 +0200)]
treeview: Remove deprecated adjustment API
Timm Bäder [Fri, 14 Oct 2016 19:55:38 +0000 (21:55 +0200)]
combobox: Remove deprecated API
Timm Bäder [Fri, 14 Oct 2016 19:50:53 +0000 (21:50 +0200)]
adjustment: Remove deprecated API
Timm Bäder [Fri, 14 Oct 2016 19:38:50 +0000 (21:38 +0200)]
menutoolbutton: Remove deprecated API
Timm Bäder [Fri, 14 Oct 2016 19:35:35 +0000 (21:35 +0200)]
popover: Remove deprecated API
Timm Bäder [Fri, 14 Oct 2016 19:35:26 +0000 (21:35 +0200)]
range: Remove unused class struct members
Timm Bäder [Fri, 14 Oct 2016 19:19:33 +0000 (21:19 +0200)]
filechooserbutton: Remove deprecated API
Timm Bäder [Fri, 14 Oct 2016 19:14:18 +0000 (21:14 +0200)]
messagedialog: Remove deprecated API
Timm Bäder [Fri, 14 Oct 2016 14:01:56 +0000 (16:01 +0200)]
button: Add icon-name property
Remove the old-style button construction that allowed to show both an
icon and a label and change visibility based on a GtkSetting.